package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import com.itheima.pojo.OrderSettingVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Mapper
public interface OrderDao {
    /*根据id查询预约*/

    Integer count(Date date);
    /*新增预约*/
    @Insert("insert into t_ordersetting(orderDate,number,reservations)" +
            "values (#{orderDate},#{number},0)" )
    void addNumberByOrderDate(OrderSetting orderSetting);
    /*修改预约*/
    @Update("update t_ordersetting set number=#{orderSetting.number} where orderDate=#{date}")
    void editNumberByOrderDate(OrderSetting orderSetting,Date date);

    List<OrderSetting> getOrderSettingByMonth(String month);
    /*将文件内容存入数据库*/
    void insert(ArrayList<OrderSetting> orderSettings);
}
